package com.hdaccp.shuiguoD.service.impl;

import com.hdaccp.shuiguoD.dao.HuiyuanDao;
import com.hdaccp.shuiguoD.entity.Huiyuan;
import com.hdaccp.shuiguoD.entity.Huiyuanjibie;
import com.hdaccp.shuiguoD.service.HuiyuanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class HuiyuanServiceImpl implements HuiyuanService {

    @Autowired
    private HuiyuanDao huiyuanDao;

    @Override
    public List<Huiyuan> getAll() {
        return huiyuanDao.queryAll();
    }

    @Override
    public long findTotalCount(String hname) {
        return huiyuanDao.getTotalCount(hname);
    }

    @Override
    public List<Huiyuan> findAll(String hname, int offset, int limit) {

        return huiyuanDao.query(hname,offset,limit);
    }



    @Override
    public int dele(int hid) {
        return huiyuanDao.del(hid);
    }

    @Override
    public Huiyuan getById(int hid) {
        return huiyuanDao.getId(hid);
    }

    @Override
    public int upd(Huiyuan huiyuaninfo) {
        return huiyuanDao.update(huiyuaninfo);
    }

    @Override
    public int zj(Huiyuan huiyuaninfo) {
        return huiyuanDao.add(huiyuaninfo);
    }

    @Override
    public int query(String hname) {
        return huiyuanDao.query1(hname);
    }

    @Override
    public Huiyuanjibie query1(int hqid) {
        return huiyuanDao.query2(hqid);
    }


}
